package com.wysql.common.util;

import org.springframework.web.multipart.MultipartFile;

import java.util.List;

public class FileUtils {
    public static boolean typeIs(MultipartFile file, List<String> suffix) {
        String originalFilename = file.getOriginalFilename();
        if (originalFilename == null) {
            return false;
        }
        String type = originalFilename.substring(originalFilename.lastIndexOf("."));
        return suffix.contains(type.replace(".", ""));
    }
}
